<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:cms="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=EDGE"/>
    <title>登录</title>
</head>
<body>
<table>
    <tr><td>用户名:</td><td><input type="text" class="username"></input></td></tr>
    <tr><td>密码:</td><td><input type="password" class="password"></input></td></tr>
    <tr><td><input type="button" value="提交" class="submit"/></td><td></td></tr>
</table>
<script src="/static/js/jquery-1.11.3.min.js" type="text/javascript"></script>
<script>
    $(function () {
        $(".submit").click(function () {
            var username=$(".username").val();
            var password=$(".password").val();
            $.ajax({
                url:'/login/userName',
                type:'POST',
                data:{
                    username:username,
                    password:password
                },success:function (result) {
                    alert(JSON.stringify(result));
                }
            })
        })
    })
</script>
</body>
</html>
